home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
ai
/
fuzzy
/
parser.s
< prev
next >
Wrap
Text File
|
1986-11-29
|
3KB
|
53 lines
-------------------------------------------------------------------------------
-- --
-- Library Unit: Parser --
-- --
-- Author: Bradley L. Richards --
-- --
-- Version Date Notes . . . --
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- 1.0 22 May 86 Initial Version --
-- 1.1 19 Jun 86 Lotsa revisions due to Prover design --
-- 2.0 20 Jun 86 Version number change only (for consistancy) --
-- 2.05 13 Jul 86 Split spec and body into separate files --
-- 2.1 22 Jul 86 Demonstration Version --
-- 2.2 28 Jul 86 Added parse_read. Initial operational version --
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
-- --
-- Library units used: Data_def, listing, token, unchecked_deallocation --
-- --
-- Description: This package parses an input program, and constructs an --
-- abstract syntax tree for the program. Start_parser and stop_parser --
-- are the initialization and clean up routines. Parse_file parses a --
-- complete input file. Parse_read parses a single element for the --
-- READ predicate. Parse_request parses a user request to Fuzzy --
-- Prolog (i.e. the user assertion or query to be "proven"). Release --
-- is used to discard ASTs when they are no longer needed. It is --
-- included in this package since this is the package which constructs --
-- the original ASTs. --
-- --
-------------------------------------------------------------------------------
-- --
-- Package Specification --
-- --
-------------------------------------------------------------------------------
with data_def, listing, token, unchecked_deallocation;
use data_def, listing, token;
package parser is
procedure parse_file( abstract_syntax_tree : out AST_ptr );
procedure parse_read( elt : out argument_ptr; eof : out boolean );
procedure parse_request( abstract_syntax_tree : out AST_ptr;
eof : out boolean );
procedure release( tree, stop : AST_ptr);
procedure start_parser( input_file, output_file : in string );
procedure stop_parser;
private
procedure free_AST is new unchecked_deallocation(AST, AST_ptr);
end parser;